<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController::index');
Router::post('/sms/send', App\Controller\SmsController::class . '::send');
Router::get('/captcha', App\Controller\SmsController::class . '::captcha');

Router::post('/user/register', App\Controller\UserController::class . '::register');
Router::post('/user/save', App\Controller\UserController::class . '::save');
Router::post('/user/login', App\Controller\UserController::class . '::login');
Router::post('/user/password', App\Controller\UserController::class . '::password');
Router::get('/user/info', App\Controller\UserController::class . '::info');

Router::get('/category', App\Controller\CategoryController::class . '::index');

Router::post('/question/{id:\d+}', App\Controller\QuestionController::class . '::publish');
Router::delete('/question/{id:\d+}', App\Controller\QuestionController::class . '::delete');
Router::post('/question/{id:\d+}/delete', App\Controller\QuestionController::class . '::delete');
Router::get('/question', App\Controller\QuestionController::class . '::index');

Router::post('/answer/{id:\d+}', App\Controller\AnswerController::class . '::publish');
Router::get('/answer', App\Controller\AnswerController::class . '::index');

Router::post('/reply/{id:\d+}', App\Controller\ReplyController::class . '::publish');
Router::get('/reply', App\Controller\ReplyController::class . '::index');
